﻿
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<%
set conn=server.createobject("adodb.connection")
connstr="Driver={SQL Server};SERVER=N-SERVER\MSSQLSERVER2;UID=sa;Password=jckj2008;DATABASE=UnexDB2"
conn.open connstr

	Language=Request("Language")
	action=Request("action")
id=request("id")
shuliang=request("shuliang")
AccountNo=request("AccountNo")
name=request("name")
    newdate=Request("date")


Dim Sql2,Rs2
Sql2 = "Select Uid From TblUserInfo where AccountNo='"&AccountNo&"'" 

Set Rs2 = Server.CreateObject("Adodb.RecordSet") 
Rs2.Open Sql2,conn,1,1 

if not Rs2.eof then
uid=Rs2("Uid")
else
			Response.Write "<script>"   
			Response.Write "alert('帐号没有填写或填写不对');"
			Response.Write "location.href= 'truckcheck.asp';" 		
			Response.Write "</script>"
			Response.end()
end if

Rs2.close





	

	  if trim(action)="add" then		    	

		dateas=month(newdate)&"/"&day(newdate)&"/"&year(newdate)
				

		sql="insert into truckShip (accountNo,shuliang,date,name)"
		sql=sql & " values(N'"&AccountNo&"','"&shuliang&"','"&dateas&"','"&name&"')"	


		conn.execute(sql)

		
		

	  end if
	  
	     Response.Write "<script>alert(""access"");location.href='truckcheck.asp';</script>"
	  
%>
</html>